
		use "$LocalData\BartikAnalyticData_2digit.dta", clear


				keep if year>2002  //Restricts to period of analysis
				
				levelsof year, local(y) //Creates a macro list of all years
				
				foreach year in `y' {
					foreach ind_var of varlist c_i_share_2000* {
						qui gen t`year'_`ind_var' = `ind_var' * (year == `year')
						}
					}
			
				qui tab year, gen(year_) //Generates year dummies
				drop year_1
				qui tab geography, gen(geography_) //Generates year dummies
				drop geography_1

		gen lngdp2000 = ln(exp(ln_pop_2000)*income_2000)
				
		local years  (year>2002) & abs(gsmall_dep1)<5  & !missing(bartikGS1) & !missing(gSmallFirm1) & !missing(lngdp2000)


		
		eststo: reg ln_pop_2000 bartikGS1 if `years', vce(cluster cluster3) 
			outreg2 using "$LocalData\Tables\RFS_Balance", tex replace ///
				ctitle(LnPop2000) ///
				addtext(REG, OLS)
		eststo: reg pop2000_2002 bartikGS1 if `years', vce(cluster  cluster3)
			outreg2 using "$LocalData\Tables\RFS_Balance", tex append ///
				ctitle(DPop2000-2002) ///
				addtext(REG, OLS)
		eststo: reg lngdp2000 bartikGS1 if `years', vce(cluster cluster3)
			outreg2 using "$LocalData\Tables\RFS_Balance", tex append ///
				ctitle(LnGDP2000) ///
				addtext(REG, OLS)
		eststo: reg lngdp2000_2002 bartikGS1 if `years', vce(cluster cluster3)
		outreg2 using "$LocalData\Tables\RFS_Balance", tex append ///
				ctitle(DLnGDP2000-2002) ///
				addtext(REG, OLS)
		eststo: reg unem_2000 bartikGS1 if `years', vce(cluster cluster3)
		outreg2 using "$LocalData\Tables\RFS_Balance", tex append ///
				ctitle(Unem2000) ///
				addtext(REG, OLS)
		eststo: reg unem2000_2002 bartikGS1 if `years', vce(cluster cluster3)
		outreg2 using "$LocalData\Tables\RFS_Balance", tex append ///
				ctitle(Unem2000-2002) ///
				addtext(REG, OLS)
		eststo: reg hpi2000_2002 bartikGS1 if `years', vce(cluster cluster3)
		outreg2 using "$LocalData\Tables\RFS_Balance", tex append ///
				ctitle(DHPI2000-2002) ///
				addtext(REG, OLS)
				
				
				
				
		local years  (year>2002) & abs(gsmall_dep1)<5  & !missing(bartikGS1) & !missing(gSmallFirm1) & !missing(lngdp2000)
				
		eststo: reg ln_pop_2000 bartikGL1 if `years', vce(cluster cluster3) 
		outreg2 using "$LocalData\Tables\RFS_BalanceB", tex replace ///
				ctitle(LnPop2000) ///
				addtext(REG, OLS)
		eststo: reg pop2000_2002 bartikGL1 if `years', vce(cluster  cluster3)
			outreg2 using "$LocalData\Tables\RFS_BalanceB", tex append ///
				ctitle(DPop2000-2002) ///
				addtext(REG, OLS)
		eststo: reg lngdp2000 bartikGL1 if `years', vce(cluster cluster3)
			outreg2 using "$LocalData\Tables\RFS_BalanceB", tex append ///
				ctitle(LnGDP2000) ///
				addtext(REG, OLS)
		eststo: reg lngdp2000_2002 bartikGL1 if `years', vce(cluster cluster3)
		outreg2 using "$LocalData\Tables\RFS_BalanceB", tex append ///
				ctitle(DLnGDP2000-2002) ///
				addtext(REG, OLS)
		eststo: reg unem_2000 bartikGL1 if `years', vce(cluster cluster3)
		outreg2 using "$LocalData\Tables\RFS_BalanceB", tex append ///
				ctitle(Unem2000) ///
				addtext(REG, OLS)
		eststo: reg unem2000_2002 bartikGL1 if `years', vce(cluster cluster3)
		outreg2 using "$LocalData\Tables\RFS_BalanceB", tex append ///
				ctitle(Unem2000-2002) ///
				addtext(REG, OLS)
		eststo: reg hpi2000_2002 bartikGL1 if `years', vce(cluster cluster3)
		outreg2 using "$LocalData\Tables\RFS_BalanceB", tex append ///
				ctitle(DHPI2000-2002) ///
				addtext(REG, OLS)
